package strategy_mode;

import java.util.function.Predicate;

/**
 * Description: 使用策略的类
 *
 * @author code-worker
 * @date 2021/09/25 14:03
 */
class Context {
    private Strategy strategy;
    Context(Strategy strategy){
        this.strategy = strategy;
    }
    int executeStrategy(int a, int b){
        return strategy.doOperation(a, b);
    }

    int executeStrategy(int a, int b, Strategy strategy){
        return strategy.doOperation(a, b);
    }
}
